package com.lb.service.impel;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lb.common.Result;
import com.lb.entity.Query;
import com.lb.entity.Student;
import com.lb.mapper.StudentMapper;
import com.lb.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@Service
public class StudentServiceimpel extends ServiceImpl<StudentMapper, Student> implements StudentService {
   @Autowired
   private StudentMapper studentMapper;
    @Override
    public List<Student> getByname(String name) {
      List<Student> result= studentMapper.getByname(name);
        //return List.of();
        return result;
    }

    @Override
    public Page<Student> getBypage(Query query) {
        Page<Student> articlePage =new  Page<>();
        articlePage.setCurrent(query.getPageNum());
        articlePage.setSize(query.getPageSize());
        Page<Student> studentPage = studentMapper.selectPage(articlePage, null);
        return studentPage;

    }


}
